Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 오토레이아웃 편의 Anchor 함수 작성 #37

Merged
merged 4 commits into from
Nov 9, 2024

Conversation

Kyxxn
Copy link
Collaborator

@Kyxxn Kyxxn commented Nov 8, 2024

#️⃣ 연관된 이슈


📝 작업 내용

  • 오토레이아웃 편의 Anchor 함수 작성
  • 영현님 커스텀 앨범 쪽 오토레이아웃 리팩토링

📒 리뷰 노트

Before

NSLayoutConstraint.activate([
    albumCollectionView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
    albumCollectionView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor),
    albumCollectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
    albumCollectionView.trailingAnchor.constraint(equalTo: view.trailingAnchor)
])

After

albumCollectionView.fillSuperview()

@Kyxxn Kyxxn added the ✨ Feature 기능 관련 작업 label Nov 8, 2024
@Kyxxn Kyxxn added this to the 0.1 milestone Nov 8, 2024
@Kyxxn Kyxxn self-assigned this Nov 8, 2024
Comment on lines +122 to +125
top: view.safeAreaLayoutGuide.topAnchor,
leading: view.leadingAnchor,
bottom: view.safeAreaLayoutGuide.bottomAnchor,
trailing: view.trailingAnchor
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

top과 bottom은 safeAreaLayoutGuide로 했습니당
괜찮을까요 ??

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋아욤!

Copy link
Collaborator

@iceHood iceHood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

둏습니다!! 역시 팀장님...

@Kyxxn Kyxxn linked an issue Nov 9, 2024 that may be closed by this pull request
Copy link
Collaborator

@k2645 k2645 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정말 수고 많으셨습니다 .ᐟ.ᐟ 👍 남긴 코멘트들이 모두 P3라서 Approve를 했는데, merge시키기 전 한 번 확인해주시면 감사하겠습니당 .ᐟ.ᐟ

Comment on lines +68 to +78
func setHorizontal(view: UIView, constant: CGFloat) {
self.translatesAutoresizingMaskIntoConstraints = false
self.setLeading(anchor: view.leadingAnchor, constant: constant)
self.setTrailing(anchor: view.trailingAnchor, constant: constant)
}

func setHorizontal(layoutGuide: UILayoutGuide, constant: CGFloat) {
self.translatesAutoresizingMaskIntoConstraints = false
self.setLeading(anchor: layoutGuide.leadingAnchor, constant: constant)
self.setTrailing(anchor: layoutGuide.trailingAnchor, constant: constant)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: 위 두 함수는 각각 어떻게 다른건가요?? 레이아웃 가이드만 넣어야하고, UIView만 넣어야하는 경우가 각각 따로 있나요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아래 코드를 의도하고 만들긴 했습니다 !
layoutGuide의 경우 불 필요할까요 ??

titleLabel.setVertical(layoutGuide: view.safeAreaLayoutGuide, constant: 20)
or
titleLabel.setVertical(view: view, constant: 20)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

옹 저런 경우가 있을 수 있겠군요 .ᐟ.ᐟ 저는 저런 이유라면 남겨도 될 것 같다는 의견입니다 .ᐟ.ᐟ

Copy link
Collaborator

@yuncheol-AHN yuncheol-AHN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 ❕

@Kyxxn Kyxxn merged commit 5714c3f into develop Nov 9, 2024
2 checks passed
@Kyxxn Kyxxn deleted the feature/#35-anchor branch November 9, 2024 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 기능 관련 작업
Projects
None yet
Development

Successfully merging this pull request may close these issues.

오토레이아웃 편리 Anchor 설정
4 participants